#define _CRT_SECURE_NO_WARNINGS 1

class Solution {
public:
    int duplicateNumbersXOR(vector<int>& nums) {
        bool hash[51] = { false };
        int res = 0;
        for (auto e : nums)
        {
            if (hash[e]) res ^= e;
            else hash[e] = true;
        }
        return res;
    }
};